package ragserverengine.neo4j

import io.ktor.server.application.call
import io.ktor.server.request.receive
import io.ktor.server.response.respond
import io.ktor.server.routing.*


fun Route.Neo4jRoutes() {

    val neo4jService = Neo4jService(application)

    // 做节点的插入
    post("/insert") {

        val request = call.receive<Neo4jInsertRequest>()

        val result = neo4jService.insertHandler(request)

        call.respond(result)
    }

    // 做单节点的查询，可以根据熟悉进行过滤
    post("/query") {

        val request = call.receive<Neo4jQueryRequest>()

        val result = neo4jService.queryHandler(request)

        call.respond(result)

    }

    post("/delet") {

    }

}